package 平时作业.代忠恒;

import java.util.Scanner;

public class LoginMenu1 {
    public void printLoginMenu1() {
            int count = 0;
            Scanner input = new Scanner(System.in);
            do {
                System.out.println("\t\t系统登录");
            System.out.println("--------------");
            System.out.println("请输入用户名");
            String uname = input.next();
            System.out.println("请输入密码");
            String upwd = input.next();
                if (uname.equals("986533") && upwd.equals("qq12")) {
                    System.out.println("登录成功!");
                    break;
                }
                else {
                    count++;
                    System.out.println("登录失败!你输入的用户名或密码错误");
                    System.out.println("密码输入错误"+count+"次，还剩下"+(3-count)+"次");
                }

        }while(count<3);
    }
}
